package com.gopay.common.util.xml.utils.converters;


public class DefaultStringConverter extends AbstractConverter {

	public DefaultStringConverter(Object defaultValue){
		this(true, defaultValue);
	}
	
	public DefaultStringConverter(boolean isUseDefaultValue, Object defaultValue){
		this.isUseDefaultValue = isUseDefaultValue;
		setDefaultValue(defaultValue);
	}

	@Override
    public Object convert(Object value) throws Exception {
		if(value instanceof String){
			return value;
		}
		throw new IllegalArgumentException("the param \"value\" is not String: " + value);
	}
}
